package com.renwei.yunlong.activity.work;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.RelativeLayout;

import com.renwei.yunlong.R;
import com.renwei.yunlong.activity.me.FeedbackActivity;
import com.renwei.yunlong.base.BaseActivity;
import com.renwei.yunlong.utils.CommonUtils;
import com.renwei.yunlong.view.SimpleOptionView;
import com.zyf.fwms.commonlibrary.utils.StatusBarUtil;

import butterknife.Bind;
import butterknife.ButterKnife;
import io.rong.imkit.RongIM;
import io.rong.imlib.model.Conversation;

/**
 * 工单相关查询--页面
 * <p>
 * Created by Administrator on 2017/8/25.
 */

public class HelpActivity extends BaseActivity implements View.OnClickListener {


    @Bind(R.id.simpleTileView)
    SimpleOptionView simpleTileView;
    @Bind(R.id.rl_guide)
    RelativeLayout rlGuide;
    @Bind(R.id.rl_chat)
    RelativeLayout rlChat;
    @Bind(R.id.rl_comment)
    RelativeLayout rlComment;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_help);
        ButterKnife.bind(this);

        StatusBarUtil.setColor(this, CommonUtils.getColor(this, R.color.title_color), 0);
        initData();

    }

    private void initData() {
        simpleTileView.setTitle("帮助中心");

        rlChat.setOnClickListener(this);
        rlComment.setOnClickListener(this);
        rlGuide.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.rl_chat:
                RongIM.getInstance().startConversation(this,
                        Conversation.ConversationType.PRIVATE, "1", "云呐客服");
                break;
            case R.id.rl_comment:
                startActivity(new Intent(this, FeedbackActivity.class));
                break;
            case R.id.rl_guide:
                GuideListActivity.openActivity(this);
                break;
            default:
                break;
        }
    }

    public static void OpenActivity(Context context) {
        Intent intent = new Intent(context, HelpActivity.class);
        context.startActivity(intent);
    }
}
